/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Classes;

import java.util.ArrayList;

/**
 *
 * @author ajou
 */
public class BuildingsInR {

    int roomid;
    ArrayList<ABuildingInR> buildings = new ArrayList<ABuildingInR>();
    
    public void setQuestions(String name, ArrayList<Integer> questions) {
        for (ABuildingInR b : buildings) {
            if (b.getBuidlingname().equals(name))
                b.setQuestions(questions);
        }
    }

    public int getRoomid() {
        return roomid;
    }

    public void setRoomid(int roomid) {
        this.roomid = roomid;
    }

    public ArrayList<ABuildingInR> getBuilinds() {
        return buildings;
    }

    public void setBuilinds(ArrayList<ABuildingInR> buildings) {
        this.buildings = buildings;
    }

    public boolean checkGameover() {
        int num = 0;
        for (ABuildingInR b : buildings) {
            if (b.getConqueredUId() != null) {
                num++;
            }
        }
        if (num == 10) {
            return true;
        }
        return false;
    }
}
